package com.punch.punchtable.service.impl;

import com.punch.punchtable.entity.Attendance;
import com.punch.punchtable.repository.AttendanceRepository;
import com.punch.punchtable.service.AttendanceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Example;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AttendanceServiceImpl implements AttendanceService {

    @Autowired
    private AttendanceRepository repository;

    @Override
    public Page<Attendance> findByPage(Example<Attendance> example, Pageable pageable) {
        return repository.findAll(example, pageable);
    }

    @Override
    public List<String> findDept() {
        return repository.findAllDept();
    }

    @Override
    public List<Attendance> findAll(Example<Attendance> example) {
        return repository.findAll(example);
    }

//    @Override
////    @Scheduled(cron = "0 0 1 * * ?")
//    //@Scheduled(cron="0/3 * * * * ?")
//    public String findAllByRole( ) {
//        repository.findAllByRole();
//        return null;
//    }


}
